p
  = link_to '新增', new_editor_path, class: "btn btn-info btn-xs"
  input type="button" value="导入" class="modal_link_up btn btn-info btn-xs"
= paginate @editors
table.table.table-inverse.table-striped.table-bordered.table-hover
  thead
    tr
      th 姓名
      th 号码
      th 角色
      th 负责小区
      th 极光推送ID
      th 操作
  tbody
    - @editors.each do |editor|
      tr
        td = editor.name
        td = editor.telephone
        td = editor.current_role
        td
          - unless editor.system?
            = editor.village ? editor.village.name : '未分配'
        td = editor.registration_id
        td
          - unless editor.system?
            = link_to '删除', editor_path(editor), data: {:confirm => 'Are you sure?'}, :method => :delete, class: "btn btn-danger btn-xs"
            = link_to '修改', edit_editor_path(editor), class: "btn btn-warning btn-xs"


div class="modal fade" id="dialog-message_up"
  div class="modal-dialog"
    div class="modal-content"
      div class="modal-header"
        <button type="button" class="close" data-dismiss="modal"
           span aria-hidden="true" &times;
           span class="sr-only" Close
      div class="modal-body"
        = form_tag import_editors_path, class: 'upload-form', remote: true, multipart: true  do
           = file_field_tag :file
           = submit_tag '上传' ,style: 'margin-top: 50px;',class: 'btn btn-info btn-sm'
      div class="modal-footer"
        button type="button" class="btn btn-default" data-dismiss="modal" 关闭

  javascript:
     // Modal Link
      $('.modal_link_up').click(function () {
         $('#dialog-message_up').modal();
    });
